package com.yunnuo.systool.code;

import java.util.Date;

/**
 * 系统基本参数
 */
public class CommonEnum {
    public enum StatusEnum {

        OK((byte)1, "启用"),
        FREEZED((byte)2, "冻结"),
        DELETE((byte)3, "删除");

        private Byte code;

        private String message;

        public Byte getCode() {
            return code;
        }

        public void setCode(Byte code) {
            this.code = code;
        }

        public String getMessage() {
            return message;
        }

        public void setMessage(String message) {
            this.message = message;
        }

        StatusEnum(Byte code, String message) {
            this.code = code;
            this.message = message;
        }
    }


    public enum FieldQuery {
        Exact(1, "精准查询"),
        Like(2, "模糊查询");

        private Integer code;

        private String message;

        FieldQuery(Integer code, String message) {
            this.code = code;
            this.message = message;
        }

        public Integer getCode() {
            return code;
        }

        public void setCode(Integer code) {
            this.code = code;
        }

        public String getMessage() {
            return message;
        }

        public void setMessage(String message) {
            this.message = message;
        }
    }
    public enum FieldType {
        String(1, String.class.getSimpleName()),
        Byte(2, Byte.class.getSimpleName()),
        Short(3, Short.class.getSimpleName()),
        Integer(4, Integer.class.getSimpleName()),
        Long(5, Long.class.getSimpleName()),
        Float(6, Float.class.getSimpleName()),
        Double(7, Double.class.getSimpleName()),
        Boolean(8, Boolean.class.getSimpleName()),
        Character(9, Character.class.getSimpleName()),
        Text(10, "Text"),
        Date(11, java.util.Date.class.getSimpleName()),
        Object(12, Object.class.getSimpleName());

        private Integer code;

        private String message;

        FieldType(Integer code, String message) {
            this.code = code;
            this.message = message;
        }

        public void setCode(java.lang.Integer code) {
            this.code = code;
        }

        public void setMessage(java.lang.String message) {
            this.message = message;
        }

        public java.lang.Integer getCode() {
            return code;
        }

        public java.lang.String getMessage() {
            return message;
        }
    }
    public enum FieldVerify {

        NoNull(1, "必填"),
        Email(2, "邮箱"),
        Phone(3, "手机"),
        Number(4, "数字"),
        Date(5, "日期"),
        Url(6, "网址"),
        IdKey(7, "身份证");


        private Integer code;

        private String message;

        FieldVerify(Integer code, String message) {
            this.code = code;
            this.message = message;
        }

        public Integer getCode() {
            return code;
        }

        public void setCode(Integer code) {
            this.code = code;
        }

        public String getMessage() {
            return message;
        }

        public void setMessage(String message) {
            this.message = message;
        }

        public boolean equals(FieldVerify fieldVerify){
            String name = name();
            return name.equals(fieldVerify.name());
        }
    }
}

